import request from "@/utils/request"

//根据课程id查询章节和小节信息
export function getChapterVideo(courseId) {
  return request({
    url: `/eduService/chapter/getChapterVideo/` + courseId,
    method: 'get',
  })
}

//添加章节
export function addChapter(chapter) {
  return request({
    url: `/eduService/chapter/addChapter/`,
    method: 'post',
    data: chapter
  })
}

//根据章节id查询章节信息
export function getChapterInfo(chapterId) {
  return request({
    url: `/eduService/chapter/getChapterInfo/` + chapterId,
    method: 'get',
  })
}

//修改章节
export function updateChapter(chapter) {
  return request({
    url: `/eduService/chapter/updateChapter/`,
    method: 'post',
    data: chapter
  })
}

//删除章节
export function removeChapter(chapterId) {
  return request({
    url: `/eduService/chapter/deleteChapter/` + chapterId,
    method: 'delete',
  })
}
